#!/usr/bin/perl -w

##HACKABOT_HELP##
# Simple little reminder
# !remindme minutes <message you want to be reminded>
##HACKABOT_HELP##

use strict;
use Hackabot::Client;
use IO::Handle;
STDOUT->autoflush(1);

my $hbc = Hackabot::Client->new;
my $msg = $hbc->readline;
my $nick = $hbc->sent_by;
my $time;

if ($msg =~ /^([0-9]+)\s+(.*)/) {
	$time = $1;
	$msg = $2;
}

if (defined $time) {
	$time = $time*60;

	print "send $nick: ok...\n";

	sleep $time;

	print "send $nick: Times up!! *$msg*\n";
}
else {
	print "send $nick: You need to give me a number!\n";
}
